const {
  override,
  addDecoratorsLegacy,
  disableEsLint,
  addWebpackAlias,
  fixBabelImports
} = require("customize-cra");
const path = require("path");

module.exports = override(
   fixBabelImports('import', {
       libraryName: 'antd-mobile',
       style: 'css',
     }),
  // 在webpack中禁用eslint
  disableEsLint(),
  // 添加webpack别名
  addWebpackAlias({
      ["@"]: path.resolve("./src"),//目录映射
      ["@a"]: path.resolve("./src/assets"),//目录映射
      ["@ai"]: path.resolve("./src/assets/img"),//目录映射
      ["@api"]: path.resolve("./src/api"),//目录映射
      ["@p"]: path.resolve("./src/pages"),//目录映射
  }),
  addDecoratorsLegacy()//开启装饰器模式
);